<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  	<title>FTP帐号管理</title>
  	<link rel="stylesheet" href="<%=path %>/css/public.css" type="text/css"  />
	<link rel="stylesheet" href="<%=path %>/css/module.css" type="text/css"  />
	<link rel="stylesheet" href="<%=path %>/css/skin_blue.css" type="text/css"  />
	<script type="text/javascript" src="<%=path %>/js/util.js"></script>
	<script type="text/javascript" src="<%=path %>/js/json.js"></script>
	<script type="text/javascript" src="<%=path %>/js/DatePicker/WdatePicker.js"></script>
	<script type="text/javascript">
		function add_update(){
			getObjById('frmFtpUser').submit();
		}
		function deleteFtpUser(){
			getObjById('frmFtpUser').action="<%=path %>/ftp!deleteFtpUser.action";
			var checkObj=getObjsByName('ftpUserChx');
			var ids='';
			for(var i=0;i<checkObj.length;i++){
				if(checkObj[i].checked){
					ids+=checkObj[i].id;
					ids+=',';
				}
			}
			if(ids==''){
				alert('请选择需要删除的帐号！');
				return;
			}
			var param={
				ids:ids
			};
			getObjById('requestData').value=Ext.util.JSON.encode(param);
			getObjById('frmFtpUser').submit();
		}
		function showCalendar(id, format) {
			if(format.toLowerCase()=="yyyy-mm-dd" || format.toLowerCase()=="y-mm-dd") {
				WdatePicker({el:id,skin:'whyGreen',lang:'zh-cn'});
			} 
			return false;
		}
		function queryPage(){
			getObjById('frmPage').submit();
		}
	</script>
 </head>
  
  <body style="overflow:auto">
  		<form action="<%=path %>/ftp!createFtpUser.action" id="frmFtpUser" enctype="multipart/form-data" method="post">
			<input type="hidden" id="requestData" name="requestData">
		</form>
	    <div class="tab_cur" >
	        	<p class="location"> <em>您的当前位置:&nbsp;&nbsp;</em><font color="blue">FTP帐号管理</font></p>
	    </div>
   
	      <div class="toolbox">
  <div class="buttonbox">
	<ul>
		<li>
			<a id="add" class="btn_zj" onclick="add_update();">
				新 增
			</a>
		</li>
		<li>
			<a id="delete" class="btn_sc" onclick="deleteFtpUser();">
				删 除
			</a>
		</li>
	</ul>
	</div>
	</div>
	<form action="<%=path %>/ftp!ftpUserList.action" id="frmPage"  name="frmPage" method="post">
		<input type="hidden" value="1" name="page" id="page" />
		<input type="hidden"  id="pageSize" name="pageSize" value="<s:property value="pageSize" />"/>
	<div class="searchbox">
			  <p class="search_con">
					<label>截止日期(小于)</label><input  name="expiration" value="<s:property value="expiration" />" id="tempdate" onclick="return showCalendar('tempdate','yyyy-MM-dd');"/>
					<button class="btn_cx" onclick="queryPage();">查 询
					</button>
				</p>
				<p class="search_title">
					<em></em>
				</p>
	</div>
	</form>
 <div class="formbox">
  <table summary="" class="datelist"  width="100%">
		<thead>
			<tr>
				<th  width="10%">
					
				</th>
				<td width="15%">帐号名称</td>
				
				<td width="45%">帐号截止日期</td>
			</tr>
		</thead>
      
		<tbody>
			
			<s:iterator value="pageBean.list" id="ftpUser">
				<tr>
					<th ><input type="checkbox" id="<s:property value="#ftpUser.id" />" name="ftpUserChx"/></th>
					<td><s:property value="#ftpUser.ftpUserName" /></td>
					<td>
						<script type="text/javascript">
							var date='<s:date name="#ftpUser.expiration" format="yyyy-MM-dd"/>';
							if(date=='1980-01-01'){
								document.write('长期帐号');
							}else{
								document.write(date);
							}
						</script>
					</td>
				</tr>
			</s:iterator>
			
		</tbody>
  </table>
  <jsp:include page="/jsp/common/page.jsp"></jsp:include>
  </div>
  </body>
</html>
